package com.wxpay.demo.utils;

import com.google.common.collect.Maps;
import com.wxpay.demo.constant.WXPayConstants;
import lombok.extern.slf4j.Slf4j;

import java.util.Map;

/**
 * @author  yls
 * @date 2021-06-21
 */
@Slf4j
public class WxResultUtil {


    /**
     * 返回微信回调方法
     * @return
     */
    public static String returnXML(String resultCode,String resultMsg){
        try {
            Map<String,String> data= Maps.newHashMap();
            data.put("return_code",resultCode);
            data.put("return_msg",resultMsg);
            return WXPayUtil.mapToXml(data);
        } catch (Exception e) {
            log.error("returnxml is error:{}",e);
            return null;
        }
    }
}
